//
//  myWannatViewController.m
//  LT
//
//  Created by dllo on 16/5/25.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "myWannatViewController.h"
#define WITDH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height

static NSString *const wannatCell = @"wannatCell";

@interface myWannatViewController ()


@property(nonatomic,strong)UITableView *wannatTableView;

//用来装已经收藏的东西的数组
@property(nonatomic,strong)NSMutableArray *wannatArray;


@end

@implementation myWannatViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor blueColor];

    self.wannatTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, WITDH, HEIGHT) style:UITableViewStylePlain];
    self.wannatTableView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.wannatTableView];
    
    self.wannatTableView.delegate = self;
    self.wannatTableView.dataSource = self;
    
    
    //跳转回原来界面
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"goback"] style:UIBarButtonItemStylePlain target:self action:@selector(leftButtonAction)];
    
    
     [self.wannatTableView registerClass:[UITableViewCell class] forCellReuseIdentifier:wannatCell];
    
}


//cell点击方法
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//逻辑
    //如果有用户登录就有记录,如果没有用户就显示空




}


//对应左按钮跳转方法
-(void)leftButtonAction{

[self dismissViewControllerAnimated:YES completion:^{
    
    
}];


}


//cell的行数由collectArray中收藏的数量来决定
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    //return self.collectArray.count;
    return 10;
    
}

//cell的高度
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 80;
    
}

//cell的显示
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:wannatCell];
    
    
    return cell;
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
